import axios from 'axios'

export default function request(config) {

  // 创建axios实例
  const instance = axios.create({
    baseURL: 'http://152.136.185.210:7878/api/m5',
    timeout: 5000
  })

  // 请求拦截
  instance.interceptors.request.use(res => {
    return res
  }, err => {
    console.log('请求错误', err);
  })

  // 响应拦截
  instance.interceptors.response.use(res => {
    return res.data
  }, err => {
    console.log('响应错误', err);
  })

  return instance(config)

}